package demo4_7;

public class Test {
    //发生动态绑定
    public static void eatFunc(Animal animal) {
        animal.eat();
    }

    public static void walk(IRunning running) {
        running.run();
    }

    public static void main(String[] args) {
        eatFunc(new Fish("小鲤鱼", 2));
        walk(new Duck("唐老鸭", 5));
    }
}
